Optimal. Leaf size=123 \[ \frac {14 d^2 \cos (a+b x)}{9 b^3}-\frac {2 (c+d x)^2 \cos (a+b x)}{3 b}-\frac {2 d^2 \cos ^3(a+b x)}{27 b^3}+\frac {4 d (c+d x) \sin (a+b x)}{3 b^2}-\frac {(c+d x)^2 \cos (a+b x) \sin ^2(a+b x)}{3 b}+\frac {2 d (c+d x) \sin ^3(a+b x)}{9 b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3392, 3377,
2718, 2713} \begin {gather*} -\frac {2 d^2 \cos ^3(a+b x)}{27 b^3}+\frac {14 d^2 \cos (a+b x)}{9 b^3}+\frac {2 d (c+d x) \sin ^3(a+b x)}{9 b^2}+\frac {4 d (c+d x) \sin (a+b x)}{3 b^2}-\frac {2 (c+d x)^2 \cos (a+b x)}{3 b}-\frac {(c+d x)^2 \sin ^2(a+b x) \cos (a+b x)}{3 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2713
Rule 2718
Rule 3377
Rule 3392
Rubi steps
\begin {align*} \int (c+d x)^2 \sin ^3(a+b x) \, dx &=-\frac {(c+d x)^2 \cos (a+b x) \sin ^2(a+b x)}{3 b}+\frac {2 d (c+d x) \sin ^3(a+b x)}{9 b^2}+\frac {2}{3} \int (c+d x)^2 \sin (a+b x) \, dx-\frac {\left (2 d^2\right ) \int \sin ^3(a+b x) \, dx}{9 b^2}\\ &=-\frac {2 (c+d x)^2 \cos (a+b x)}{3 b}-\frac {(c+d x)^2 \cos (a+b x) \sin ^2(a+b x)}{3 b}+\frac {2 d (c+d x) \sin ^3(a+b x)}{9 b^2}+\frac {(4 d) \int (c+d x) \cos (a+b x) \, dx}{3 b}+\frac {\left (2 d^2\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (a+b x)\right )}{9 b^3}\\ &=\frac {2 d^2 \cos (a+b x)}{9 b^3}-\frac {2 (c+d x)^2 \cos (a+b x)}{3 b}-\frac {2 d^2 \cos ^3(a+b x)}{27 b^3}+\frac {4 d (c+d x) \sin (a+b x)}{3 b^2}-\frac {(c+d x)^2 \cos (a+b x) \sin ^2(a+b x)}{3 b}+\frac {2 d (c+d x) \sin ^3(a+b x)}{9 b^2}-\frac {\left (4 d^2\right ) \int \sin (a+b x) \, dx}{3 b^2}\\ &=\frac {14 d^2 \cos (a+b x)}{9 b^3}-\frac {2 (c+d x)^2 \cos (a+b x)}{3 b}-\frac {2 d^2 \cos ^3(a+b x)}{27 b^3}+\frac {4 d (c+d x) \sin (a+b x)}{3 b^2}-\frac {(c+d x)^2 \cos (a+b x) \sin ^2(a+b x)}{3 b}+\frac {2 d (c+d x) \sin ^3(a+b x)}{9 b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.27, size = 86, normalized size = 0.70 \begin {gather*} \frac {-81 \left (-2 d^2+b^2 (c+d x)^2\right ) \cos (a+b x)+\left (-2 d^2+9 b^2 (c+d x)^2\right ) \cos (3 (a+b x))-6 b d (c+d x) (-27 \sin (a+b x)+\sin (3 (a+b x)))}{108 b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(264\) vs.
\(2(111)=222\).
time = 0.07, size = 265, normalized size = 2.15
method | result | size |
risch | \(-\frac {3 \left (d^{2} x^{2} b^{2}+2 b^{2} c d x +b^{2} c^{2}-2 d^{2}\right ) \cos \left (b x +a \right )}{4 b^{3}}+\frac {3 d \left (d x +c \right ) \sin \left (b x +a \right )}{2 b^{2}}+\frac {\left (9 d^{2} x^{2} b^{2}+18 b^{2} c d x +9 b^{2} c^{2}-2 d^{2}\right ) \cos \left (3 b x +3 a \right )}{108 b^{3}}-\frac {d \left (d x +c \right ) \sin \left (3 b x +3 a \right )}{18 b^{2}}\) | \(128\) |
derivativedivides | \(\frac {-\frac {a^{2} d^{2} \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3 b^{2}}+\frac {2 a c d \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3 b}-\frac {2 a \,d^{2} \left (-\frac {\left (b x +a \right ) \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3}+\frac {\left (\sin ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \sin \left (b x +a \right )}{3}\right )}{b^{2}}-\frac {c^{2} \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3}+\frac {2 c d \left (-\frac {\left (b x +a \right ) \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3}+\frac {\left (\sin ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \sin \left (b x +a \right )}{3}\right )}{b}+\frac {d^{2} \left (-\frac {\left (b x +a \right )^{2} \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3}+\frac {4 \cos \left (b x +a \right )}{3}+\frac {4 \left (b x +a \right ) \sin \left (b x +a \right )}{3}+\frac {2 \left (b x +a \right ) \left (\sin ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{27}\right )}{b^{2}}}{b}\) | \(265\) |
default | \(\frac {-\frac {a^{2} d^{2} \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3 b^{2}}+\frac {2 a c d \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3 b}-\frac {2 a \,d^{2} \left (-\frac {\left (b x +a \right ) \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3}+\frac {\left (\sin ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \sin \left (b x +a \right )}{3}\right )}{b^{2}}-\frac {c^{2} \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3}+\frac {2 c d \left (-\frac {\left (b x +a \right ) \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3}+\frac {\left (\sin ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \sin \left (b x +a \right )}{3}\right )}{b}+\frac {d^{2} \left (-\frac {\left (b x +a \right )^{2} \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{3}+\frac {4 \cos \left (b x +a \right )}{3}+\frac {4 \left (b x +a \right ) \sin \left (b x +a \right )}{3}+\frac {2 \left (b x +a \right ) \left (\sin ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \left (2+\sin ^{2}\left (b x +a \right )\right ) \cos \left (b x +a \right )}{27}\right )}{b^{2}}}{b}\) | \(265\) |
norman | \(\frac {\frac {-36 b^{2} c^{2}+80 d^{2}}{27 b^{3}}-\frac {2 d^{2} x^{2}}{3 b}+\frac {8 d^{2} \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b^{3}}+\frac {\left (-36 b^{2} c^{2}+56 d^{2}\right ) \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{9 b^{3}}-\frac {4 c d x}{3 b}+\frac {8 c d \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{3 b^{2}}+\frac {64 c d \left (\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{9 b^{2}}+\frac {8 c d \left (\tan ^{5}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b^{2}}-\frac {2 d^{2} x^{2} \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {2 d^{2} x^{2} \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {2 d^{2} x^{2} \left (\tan ^{6}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b}+\frac {8 d^{2} x \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{3 b^{2}}+\frac {64 d^{2} x \left (\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{9 b^{2}}+\frac {8 d^{2} x \left (\tan ^{5}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b^{2}}-\frac {4 c d x \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {4 c d x \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {4 c d x \left (\tan ^{6}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b}}{\left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )^{3}}\) | \(338\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 270 vs.
\(2 (111) = 222\).
time = 0.30, size = 270, normalized size = 2.20 \begin {gather*} \frac {36 \, {\left (\cos \left (b x + a\right )^{3} - 3 \, \cos \left (b x + a\right )\right )} c^{2} - \frac {72 \, {\left (\cos \left (b x + a\right )^{3} - 3 \, \cos \left (b x + a\right )\right )} a c d}{b} + \frac {36 \, {\left (\cos \left (b x + a\right )^{3} - 3 \, \cos \left (b x + a\right )\right )} a^{2} d^{2}}{b^{2}} + \frac {6 \, {\left (3 \, {\left (b x + a\right )} \cos \left (3 \, b x + 3 \, a\right ) - 27 \, {\left (b x + a\right )} \cos \left (b x + a\right ) - \sin \left (3 \, b x + 3 \, a\right ) + 27 \, \sin \left (b x + a\right )\right )} c d}{b} - \frac {6 \, {\left (3 \, {\left (b x + a\right )} \cos \left (3 \, b x + 3 \, a\right ) - 27 \, {\left (b x + a\right )} \cos \left (b x + a\right ) - \sin \left (3 \, b x + 3 \, a\right ) + 27 \, \sin \left (b x + a\right )\right )} a d^{2}}{b^{2}} + \frac {{\left ({\left (9 \, {\left (b x + a\right )}^{2} - 2\right )} \cos \left (3 \, b x + 3 \, a\right ) - 81 \, {\left ({\left (b x + a\right )}^{2} - 2\right )} \cos \left (b x + a\right ) - 6 \, {\left (b x + a\right )} \sin \left (3 \, b x + 3 \, a\right ) + 162 \, {\left (b x + a\right )} \sin \left (b x + a\right )\right )} d^{2}}{b^{2}}}{108 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 131, normalized size = 1.07 \begin {gather*} \frac {{\left (9 \, b^{2} d^{2} x^{2} + 18 \, b^{2} c d x + 9 \, b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (b x + a\right )^{3} - 3 \, {\left (9 \, b^{2} d^{2} x^{2} + 18 \, b^{2} c d x + 9 \, b^{2} c^{2} - 14 \, d^{2}\right )} \cos \left (b x + a\right ) + 6 \, {\left (7 \, b d^{2} x + 7 \, b c d - {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right )^{2}\right )} \sin \left (b x + a\right )}{27 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 284 vs.
\(2 (121) = 242\).
time = 0.34, size = 284, normalized size = 2.31 \begin {gather*} \begin {cases} - \frac {c^{2} \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{b} - \frac {2 c^{2} \cos ^{3}{\left (a + b x \right )}}{3 b} - \frac {2 c d x \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{b} - \frac {4 c d x \cos ^{3}{\left (a + b x \right )}}{3 b} - \frac {d^{2} x^{2} \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{b} - \frac {2 d^{2} x^{2} \cos ^{3}{\left (a + b x \right )}}{3 b} + \frac {14 c d \sin ^{3}{\left (a + b x \right )}}{9 b^{2}} + \frac {4 c d \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{3 b^{2}} + \frac {14 d^{2} x \sin ^{3}{\left (a + b x \right )}}{9 b^{2}} + \frac {4 d^{2} x \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{3 b^{2}} + \frac {14 d^{2} \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{9 b^{3}} + \frac {40 d^{2} \cos ^{3}{\left (a + b x \right )}}{27 b^{3}} & \text {for}\: b \neq 0 \\\left (c^{2} x + c d x^{2} + \frac {d^{2} x^{3}}{3}\right ) \sin ^{3}{\left (a \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.82, size = 137, normalized size = 1.11 \begin {gather*} \frac {{\left (9 \, b^{2} d^{2} x^{2} + 18 \, b^{2} c d x + 9 \, b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (3 \, b x + 3 \, a\right )}{108 \, b^{3}} - \frac {3 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (b x + a\right )}{4 \, b^{3}} - \frac {{\left (b d^{2} x + b c d\right )} \sin \left (3 \, b x + 3 \, a\right )}{18 \, b^{3}} + \frac {3 \, {\left (b d^{2} x + b c d\right )} \sin \left (b x + a\right )}{2 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.98, size = 174, normalized size = 1.41 \begin {gather*} \frac {\frac {3\,d^2\,x\,\sin \left (a+b\,x\right )}{2}-\frac {d^2\,x\,\sin \left (3\,a+3\,b\,x\right )}{18}+\frac {3\,c\,d\,\sin \left (a+b\,x\right )}{2}-\frac {c\,d\,\sin \left (3\,a+3\,b\,x\right )}{18}}{b^2}-\frac {\frac {3\,c^2\,\cos \left (a+b\,x\right )}{4}-\frac {c^2\,\cos \left (3\,a+3\,b\,x\right )}{12}+\frac {3\,d^2\,x^2\,\cos \left (a+b\,x\right )}{4}-\frac {d^2\,x^2\,\cos \left (3\,a+3\,b\,x\right )}{12}-\frac {c\,d\,x\,\cos \left (3\,a+3\,b\,x\right )}{6}+\frac {3\,c\,d\,x\,\cos \left (a+b\,x\right )}{2}}{b}+\frac {3\,d^2\,\cos \left (a+b\,x\right )}{2\,b^3}-\frac {d^2\,\cos \left (3\,a+3\,b\,x\right )}{54\,b^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________